// ++++++++++++++++++++++++++++++++++++++++
// 《零基础Go语言算法实战》源码
// ++++++++++++++++++++++++++++++++++++++++
// Author:廖显东（ShirDon）
// Blog:https://www.shirdon.com/
// Gitee:https://gitee.com/shirdonl/goAlgorithms.git
// Buy link :https://item.jd.com/14101229.html
// ++++++++++++++++++++++++++++++++++++++++

package main

import (
	"fmt"
	"strconv"
)

type Person struct {
	firstName string
	lastName  string
}

func (p *Person) FullName() string {
	return p.firstName + " " + p.lastName
}

type Employee struct {
	person  Person
	empID   int
	company string
}

func (e *Employee) EmployeeInfo() string {
	return "Name: " + e.person.FullName() + ", ID: " + strconv.Itoa(e.empID) + ", Company: " + e.company
}

func main() {
	p := Person{
		"Jack",
		"Barry",
	}
	e := Employee{
		person: p,
	}
	res := e.EmployeeInfo()
	fmt.Println(res)
}

//$ go run inheritance.go
//Name: Jack Barry, ID: 0, Company:
